package chapter5.section4;

//程序5-7：演示this作用的实例
public class Account0507 {
    private final String id;
    private final String name;

    // 定义构造方法
    public Account0507(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public static void main(String[] args) {
        Account0507 act = new Account0507("0701101", "张华");
        System.out.println(act.getName());
    }

    // 返回对象的姓名
    public String getName() {
        return this.name;
    }
}